<template>
  <div id="app">
    <div
      @touchstart="handleTouch"
      @click="handleCLick"
      @touchend="handleTouchEnd"
    >
      我要点一下
    </div>
    <div class="box">{{ name | fnName() }}</div>
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'App',
  filters: {
    fnName: function (value) {
      return value + '河北'
    }
  },
  data() {
    return {
      num: 0,
      timer: null,
      name: '张三'
    }
  },
  methods: {
    handleTouch() {
      this.timer = window.setInterval(() => {
        this.num++
      }, 10)
      console.log(12333)
    },
    handleCLick() {
      console.log(1222222222222)
      this.num = 0
      window.clearInterval(this.timer)
    },
    handleTouchEnd() {
      console.log(this.num)
      this.num = 0
      window.clearInterval(this.timer)
      console.log('jieshul')
    }
  }
}
</script>
